package com.hengpeng.itfin.service.repayment;

import java.util.Date;
import java.util.List;

import com.hengpeng.common.exception.ServiceResult;
import com.hengpeng.itfinbase.message.partner.ReconciliationResponseMsg;
import com.hengpeng.itfinbase.message.partner.RepaymentRequestMsg;
import com.hengpeng.itfinbase.message.partner.RepaymentResponseMsg;
import com.hengpeng.itfinbase.message.partner.TrfReconciliationResponseMsg;

/**
 * <pre>
 * 还款追偿服务类
 * </pre>
 * @author weiyuan
 * @version 1.0, 2015年5月30日
 */
public interface RepaymentService
{
	
	/**
	 * <pre>
	 * 判断当前还款计划是否已经还清
	 * </pre>
	 * @param borrowInfoId 借款标的id
	 * @param curRecNum 当前还款计划期数
	 * @return
	 */
	public boolean checkRepaymentPlanIsRepaymented (Long borrowInfoId, Integer curRecNum);
	/**
	 * <pre>
	 * 判断当前借款标的是否已经还清
	 * </pre>
	 * @param borrowInfoId 借款标的id
	 * @return
	 */
	public boolean checkBorrowInfoIsRepaymented(Long borrowInfoId);
	/**
	 * <pre>
	 * 处理批次还款结果
	 * </pre>
	 * @param response
	 */
	public ServiceResult<String> dealBatchRepaymentResult(RepaymentResponseMsg response);

	/**
	 * <pre>
	 * 处理还款结果
	 * </pre>
	 * @param response
	 */
	public ServiceResult<String> dealRepaymentResult(RepaymentResponseMsg response);

	/**
	 * <pre>
	 * 批量还款请求前动作
	 * </pre>
	 * @param reqMsg
	 */
	public void packBatchRepayment(RepaymentRequestMsg reqMsg);

	/**
	 * <pre>
	 * 还款请求前动作
	 * </pre>
	 * @param reqMsg
	 */
	public void packRepayment(RepaymentRequestMsg reqMsg);

	/**
	 * <pre>
	 * 还款请求前,收款计划批次号更新
	 * </pre>
	 * @param receivePlanIds
	 * @param batchId
	 */
	public void setReceivePlanBatch(List<Long> receivePlanIds, String batchId);

	/**
	 * <pre>
	 * 还款对账
	 * </pre>
	 * @param pageNum
	 * @param pageSize
	 * @param beginDate
	 * @param endDate
	 */
	public void repaymentReconciliation(Integer pageNum, Integer pageSize, Date beginDate, Date endDate);

	/**
	 * <pre>
	 * 执行还款对账
	 * </pre>
	 * @param pageNum
	 * @param pageSize
	 * @param beginDate
	 * @param endDate
	 * @return
	 */
	public ReconciliationResponseMsg doRepaymentReconciliation(Integer pageNum, Integer pageSize, Date beginDate,
			Date endDate);

	/**
	 * <pre>
	 * 商户扣款对账
	 * </pre>
	 * @param pageNum
	 * @param pageSize
	 * @param beginDate
	 * @param endDate
	 */
	public void trfReconciliation(Integer pageNum, Integer pageSize, Date beginDate, Date endDate);

	/**
	 * <pre>
	 * 执行商户扣款对账
	 * </pre>
	 * @param pageNum
	 * @param pageSize
	 * @param beginDate
	 * @param endDate
	 * @return
	 */
	public TrfReconciliationResponseMsg doTrfReconciliation(Integer pageNum, Integer pageSize, Date beginDate,
			Date endDate);
}
